package org.edu.modules.message.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.edu.modules.message.entity.VeMsgDrafts;
import org.edu.modules.message.mapper.VeMsgDraftsMapper;
import org.edu.modules.message.service.IVeMsgDraftsService;
import org.edu.modules.message.vo.MessageVo;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Description: 草稿箱
 * @Author: jeecg-boot
 * @Date:   2021-05-07
 * @Version: V1.0
 */
@Service
public class VeMsgDraftsServiceImpl extends ServiceImpl<VeMsgDraftsMapper, VeMsgDrafts> implements IVeMsgDraftsService {

    @Override
    public boolean saveDrafts(MessageVo messageVo) {
        VeMsgDrafts veMsgDrafts = new VeMsgDrafts();
        veMsgDrafts.setChannel(messageVo.getChannelStr());
        veMsgDrafts.setTitle(messageVo.getTitle());
        veMsgDrafts.setContent(messageVo.getContent());
        veMsgDrafts.setSendBy(messageVo.getSendBy());
        veMsgDrafts.setSendTo(messageVo.getSendTo());
        baseMapper.insert(veMsgDrafts);
        return true;
    }

    @Override
    public int importExcel(List<Map<String, Object>> list) {
        return 0;
    }
}
